import os
from pathlib import Path

# 基础配置
BASE_DIR = Path(__file__).resolve().parent.parent
CACHE_DIR = BASE_DIR / "data" / "cache"
CACHE_DIR.mkdir(parents=True, exist_ok=True)

# 向量缓存配置
VECTOR_CACHE_FILE = CACHE_DIR / "warehouse_vectors_v1.0.pkl"  # 带版本号

# 模型配置
OPENAI_MODEL = "BAAI/bge-large-zh-v1.5"
OPENAI_API_KEY = "sk-aswwzdvvimeybiiokqebixpkhbmcftlbgkubssfuodifqjcf"
OPENAI_BASE_URL = "https://api.siliconflow.cn/v1"

# 批量处理配置
MAX_BATCH_SIZE = 32
MAX_RETRY_ATTEMPTS = 5

# 相似度阈值
NAME_SIMILARITY_THRESHOLD = 0.8
SPEC_SIMILARITY_THRESHOLD = 0.5
NAME_SIM_WEIGHT = 0.5
SPEC_SIM_WEIGHT = 0.5

# 数据库配置
DB_CONFIG = {
    "host": "119.45.254.73",
    "port": 23306,
    "user": "root",
    "password": "brysj317hhrhl!@#",
    "database": "material-manage",
    "pool_name": "heguangAI",
    "pool_size": 8
}

# 性能测试配置
PERF_TEST_SIZES = [1000, 10000, 50000, 100000]  # 测试数据量